package Java.com.hcj.realization.utils;

import java.io.File;

/**
 * Created by an on 2016/9/27.
 */
public class Folder {

    public String folder(String folderName){
        String file=folderName;
        String path=file.replace(".", "\\");
        try {
            File file1=new File("d:");
            File file2=new File("e:");
            File file3=new File("f:");
            File file4=new File("g:");

            if (file1.exists()) {
                File dir = new File(file1+"\\src\\"+path);
                dir.mkdirs();
                return dir.toString();
            }
            if (file2.exists()) {
                File dir = new File(file2+"\\src\\"+path);
                dir.mkdirs();
                return dir.toString();
            }
            if (file3.exists()) {
                File dir = new File(file3+"\\src\\"+path);
                dir.mkdirs();
                return dir.toString();
            }
            if (file4.exists()) {
                File dir = new File(file4+"\\src\\"+path);
                dir.mkdirs();
                return dir.toString();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "error";
    }


}
